<template>
<h3>LifeCycle组件---{{count}}</h3>
<button type="button" class="btn btn-primary" @click="count+=1">+1</button>
</template>

<script>
export default{
    name:'LifeCycle',
    data(){
        return{
            count:0,
        }
    },
    beforeCreate() {
        console.log('beforeCreated被创建')
        console.log(this.count);
    },
    // 组件在内存中被创建完毕了
    created() {
        console.log("created:组件在内存中被创建完毕了");
        console.log(this.count);
    },
    // 组件第一次被渲染到了页面上
    mounted() {
        console.log('mounted:组件第一次被渲染到了页面上');
    },
    // 组件被重新渲染完毕
    updated(){
        console.log('updated:组件被重新渲染完毕');
    },
    // 组件被销毁完毕
    unmounted() {
        console.log('unmounted:组件被销毁完毕');
    },
}
</script>

<style lang="less" scoped></style>